package com.moleq.mgpos.widget;

import com.moleq.device.DeviceManager;
import com.moleq.enums.PaymentType;
import com.moleq.logic.TransactionManager;
import com.moleq.models.SaleListItem;
import com.moleq.util.MoleQUtil;


public class DisplayScreen {

	private DeviceManager mDeviceManager = DeviceManager.getInstance();
	private static DisplayScreen sInstance = new DisplayScreen();
	
	public static DisplayScreen getInstance() {
		return sInstance;
	}
	
	public void showItemToDisplayScreen(SaleListItem item){
		mDeviceManager.screen.displayLine(item.getName() + "\n" + " "
				+ MoleQUtil.fixPriceForScreen(item.getPrice()));
	}

	public void showTenderToDisplayScreen(TransactionManager mPaymentMgr) {
		mDeviceManager.screen.displayLine("Tender: "+MoleQUtil.fixPriceForScreen(mPaymentMgr.getAmountOfPaidUp()) 
				+"\n"+ "Change: "+MoleQUtil.fixPriceForScreen(mPaymentMgr.getChange()));
		
	}

	public void showTenderToDisplayScreen(PaymentType paymentType,double paid) {
		mDeviceManager.screen.displayLine("Tender\n" + paymentType.getText() + ":" + MoleQUtil.fixPriceForScreen(paid));
		
	}
}
